home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
016a
/
inpt12.zip
/
INPUT.DOC
next >
Wrap
Text File
|
1991-10-09
|
15KB
|
351 lines
INPUT.EXE 1.2
Copyright 1991 by Chuck Steenburgh
If you use batch files very often, you've probably acquired
a program called ASK.COM or QUERY.COM or something similar
that allows you to ask questions and receive simple respones.
Usually, this involves typing an ECHO command with your
question, followed by ASK.COM or whatever. If you do this
alot, you will probably appreciate the fact the INPUT.EXE
will accomplish the jobs of both the ECHO and ASK commands.
Add to this the greater flexibility that INPUT.EXE offers
in presenting your prompt to the user and in receiving input,
and you'll be sold.
Usage: INPUT ["prompt"] [color] [/c] [/i] [/s] [/y] [/n] |
"prompt" Enter the text you would like to
appear to prompt the user for
input. This can be up to 59 char-
acters and must be enclosed in
quotation marks.
color Enter a number representing the
color in which you want your mes-
sage to appear. You must, of
course, have a color monitor and
card. See Appendix 3.
/c Include this switch if you want
your prompt message centered on
the current line. If you include
this switch, you MUST include a
color value.
/s Show keypress. Adding this switch
will cause INPUT to display the
errorlevel value returned. Use this
for quick "debugging" of your use
of INPUT.EXE
/i Use this for a case-insensitive error
level return. If this switch is
included on the command line, pressing
a letter a-z (lower case) will return
the same value as if the corresponding
key A-Z (upper case) were pressed.
/y Use this for a yes-no only response. |
If the "n" key is pressed, errorlevel |
of "0" is returned; pressing any other|
key returns an errorlevel of 1. The |
prompt "(Y/n)" is appended to the nor-|
mal prompt specified by the user. |
Page 1
/n Use this for a yes-no only response. |
If the "y" key is pressed, errorlevel |
of "1" is returned; pressing any other|
key returns an errorlevel of 0. The |
prompt "(y/N)" is appended to the nor-|
mal prompt specified by the user. |
This switch takes precedence over the |
/y switch. |
The command line parameters may be entered in any
order, may be in any case, and may be preceded by |
either the "/" or "-" character. |
Examples:
INPUT "Select a number from one to 10"
This prints the text "Select on number from one to 10"
on the current line and waits for a keypress.
INPUT "Press any key to continue" 79
This prints the text "Press any key to continue" on the
current line in bright white on a red background and waits
for a keypress.
INPUT "Press the space bar to exit" 143 /c
This prints the text "Press the space bar to exit" cen-
tered on the current line in flashing bright white on a black
background.
INPUT /s /i "Press any key..." /c 14
Prompts user with "Press any key..." in yellow on black.
Returns a case-insensitive errorlevel and displays it on the
screen before terminating.
INPUT "Do you wish to continue?" /s 79 /y |
Prompts user with "Do you wish to continue? (Y/n)" in |
white on red. Returns errorlevel of 1 unless the "n" key is |
pressed. Displays errorlevel on screen. |
INPUT will also sound an alarm to let the user know that
a response is expected.
When a key is pressed, INPUT will set the errorlevel equal
to the ASCII value of the key pressed. This is slightly dif-
ferent from BATBOX in that in normal operation INPUT is case
sensitive and will allow you to distinguish between upper and
lower case letters. If you want a case-insensitive return, use
the /i switch. See Appendix 2 for a complete list of the ASCII
characters theoretically supported by INPUT.
Page 2
If you want greater control over the placement of your prompt
message on the screen, use WRITE in conjunction with INPUT.
Use WRITE to display your prompt then use INPUT without the
"prompt," color, or /c parameters.
INPUT is part of STEENBURGH'S STUFF Mildly Useful Utilities.
STEENBURGH'S STUFF includes the following programs:
BATBOX: Simple menu creation/input system
CLK: Displays time on screen
FREEDISK: Checks for available disk space
INPUT: Simple prompt/input system
KLS: Colorful screen-clearing utility
LAUNCHER: File selection/execution system
MUSIC11: Plays transcribed sheet music on the PC
RAND: Random number generator
SKIP: Prints blank lines from batch files
SOUNDER: Wide range of noise making options
WAITFOR: Timed pauses
WHENISIT: Date/time telling utility
WRITE: Colorful output anywhere on screen
XD: Create/switch directories at the same time
The current version of STEENBURGH'S STUFF is 1.5, and can
be found on many BBS's as STUF15.ZIP (earlier versions include
STUF14.ZIP, STUF13.ZIP, etc.). It can also be found on Compu-
Serve in the IBMSYS libraries.
DISCLAIMER
The programs described in this documentation are guaran-
teed to absolutely nothing! They have, however, in my exper-
ience performed essentially as described herein. The author
will not be responsible for any loss or damages caused through
the use of these programs.
All trademarks are property of their respective owners.
The programs and documentation are Copyright 1991 by Chuck
Steenburgh. You are encouraged to distribute these programs
provided the following conditions are met:
- all files contained in this archive must be distrib-
uted together in UNMODIFIED form
- you charge no more than a reasonable fee for copying or
subscription, and clearly indicate that payment of such
a fee does NOT grant ownership of the programs.
You may evaluate these programs for up to 30 days on a free
trial basis. After 30 days, you should register your use of
these programs. The registration fee is $10, payable to the
Page 3
author at the address given below. This registration fee in-
cludes registration of ALL the programs described above as
part of STEENBURGH'S STUFF.
Let's be real: I don't plan to make alot of money this way.
Registration does have its advantages:
- I am improving these programs all the time. Registration
will get you IMMEDIATELY a disk with the latest version,
which includes a version of BATBOX with user-selected
menu colors. When Version 2.0 of these utilities is re-
leased, you will also receive that free of charge.
- While I can't promise to include everyone's suggestions
in program updates, you can bet I'll listen to registered
users before any of you scrounges out there.
- You will me feel all warm and fuzzy and appreciated, and
all that good stuff.
- You will also get an evaluation copy of my text-file for-
matting program (used to produce the margins in this doc-
ument).
Send comments/registrations to:
Chuck Steenburgh
304A North Main Street
Lexington, VA 24450
(703)464-5290
CIS 72330,1776 (I haunt the IBMSYS and IBMPRO forums)
Page 4
APPENDIX 2
Errorlevel Codes Produced by INPUT
Code Key Pressed Code Key Pressed
==== =========== ==== ===========
1 Ctrl-A 2 Ctrl-B
3 Ctrl-C 4 Ctrl-D
5 Ctrl-E 6 Ctrl-F
7 Ctrl-G 8 Ctrl-H
9 Ctrl-I 10 Ctrl-J
11 Ctrl-K 12 Ctrl-L
13 Ctrl-M 14 Ctrl-N
15 Ctrl-O 16 Ctrl-P
17 Ctrl-Q 18 Ctrl-R
19 Ctrl-S 20 Ctrl-T
21 Ctrl-U 22 Ctrl-V
23 Ctrl-W 24 Ctrl-X
25 Ctrl-Y 26 Ctrl-Z
27 ESC 28 Ctrl-\
29 Ctrl-] 30 Ctrl-^
31 Ctrl-_ 32 (space)
33 ! 34 "
35 # 36 $
37 % 38 &
39 ' 40 (
41 ) 42 *
43 + 44 ,
45 - 46 .
47 / 48 0
49 1 50 2
51 3 52 4
53 5 54 6
55 7 56 8
57 9 58 :
59 ; 60 <
61 = 62 >
63 ? 64 @
65 A 66 B
67 C 68 D
69 E 70 F
71 G 72 H
73 I 74 J
75 K 76 L
77 M 78 N
79 O 80 P
81 Q 82 R
83 S 84 T
85 U 86 V
87 W 88 X
89 Y 90 Z
91 [ 92 \
93 ] 94 ^
95 _ 96 `
97 a 98 b
99 c 100 d
101 e 102 f
103 g 104 h
105 i 106 j
107 k 108 l
109 m 110 n
111 o 112 p
113 q 114 r
115 s 116 t
117 u 118 v
119 w 120 x
121 y 122 z
123 { 124 |
125 } 126 ~
APPENDIX 3
Colors for INPUT and WRITE
BACKGROUND COLOR + FORGEGROUND COLOR + SPECIAL COLOR
Background Colors Foreground Colors Special
0 Black 0 Black 128 Blink
16 Blue 1 Blue 8 Bright
32 Green 2 Green
48 Cyan 3 Cyan
64 Red 4 Red
80 Magenta 5 Magenta
96 Brown 6 Brown
112 Gray (White) 7 White
Examples:
Gray on Black: 0 + 7 = 7
Bright Blue on Brown: 96 + 1 + 8 = 105
Blinking Red on Green: 32 + 4 + 128 = 164
Blinking Bright White on Red: 64 + 7 + 128 + 8 = 207